package net.wanho.dao;

import net.wanho.entity.Teacher;
import org.apache.ibatis.annotations.*;

import java.util.Date;
import java.util.List;

public interface TeacherDaoI {
    List<Teacher> selectAll();
    Teacher selectByTno(String str);

    @Select("select * from teacher where depart= #{depart}")
    List<Teacher> selectByDepart(String str);

    @Update(" update teacher set tname=#{tname} where tno=#{tno}")
    void updateTname(@Param("tname")String tname,@Param("tno")String tno);

    @Delete(" delete from teacher where tno=#{tno} ")
    void deleteByTno(String tno);

    @Insert(" insert into teacher values(#{tno},#{tname},#{tsex},#{tbirthday},#{prof},#{depart}) ")
    void insertTeacher(@Param("tno")String tno, @Param("tname")String tname, @Param("tsex")String tsex, @Param("tbirthday")Date tbirthday,@Param("prof")String prof,@Param("depart")String depart);

    @Insert("insert into teacher values(#{tno},#{tname},#{tsex},#{tbirthday},#{prof},#{depart})")
    void insert(Teacher teacher);

    List<Teacher> selectFemale();
    List<Teacher> findByDepart(String str);
    List<Teacher> selectTeacher();
}
